package cn.xopencode.userservice.rpc.dept.dto;

import cn.xopencode.common.framework.validator.InEnum;
import cn.xopencode.userservice.enums.DeptTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * 创建部门时用的DTO
 *
 * @Author xiaodawei
 * @since 2021/9/17
 */
@Data
@Accessors(chain = true)
@ApiModel("创建部门")
public class CreateDeptDTO implements Serializable {

    /**
     * 父部门ID
     */
    @ApiModelProperty(value = "父部门ID")
    private List<String> parentIdList;
    /**
     * 部门名称
     */
    @NotBlank(message = "部门名称不能为空")
    @ApiModelProperty(value = "部门名称", required = true)
    private String name;
    /**
     * 部门类型0普通1部门2二级部门3班组
     */
    @InEnum(value = DeptTypeEnum.class, message = "部门类型必须是 {value}")
    @ApiModelProperty(value = "部门类型1部门2二级部门3班组", required = true)
    private Integer type;
    /**
     * 当前登陆用户的ID
     */
    @ApiModelProperty(value = "当前登陆用户的ID", hidden = true)
    private String userId;
    /**
     * 部门主管ID
     */
    @NotBlank(message = "部门主管ID不能为空")
    @ApiModelProperty(value = "部门主管ID", required = true)
    private String managerId;
    /**
     * 部门描述
     */
    @NotBlank(message = "部门描述不能为空")
    @ApiModelProperty(value = "部门描述", required = true)
    private String description;

}
